#include "AVLTree.hpp"
#include <iostream>

using namespace std;

void test_AVLTree()
{
	
	//int a[] = { 16,3,7,11,9,26,18,14,15 };
	int a[] = { 4,2,6,1,3,5,15,7,16,14 };
	yiwei::AVLTree<int, int> t;
	for (auto e : a)
	{
		t.Insert(make_pair(e, e));
	}

	yiwei::AVLTreeNode<int, int>* pos = t.Find(1);
	pos->_kv.second = 11;

	t.InOrder();
	cout << endl;
	cout << t.IsBalance() << endl;
	cout << endl << endl;

	for (auto e : a)
	{
		t.Erase(e);

		t.InOrder();
		cout << endl;
		cout << t.IsBalance() << endl;
		cout << endl<< endl;
	}





}

int main()
{
	test_AVLTree();
	return 0;
}
